<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>Event</title>
<script src="../../build/yahoo/yahoo.js" type="text/javascript"></script>
<script src="../../build/event/event.js" type="text/javascript"></script>
<script src="../../build/dom/dom.js" type="text/javascript"></script>
<script src="../../build/connection/connection.js" type="text/javascript"></script>
<script src="../../build/json/json.js" type="text/javascript"></script>
<style type="text/css">
    #linkContainer {
        position: relative;
        padding: 10px;
        border: 1px solid #333333;
        height: 300px;
        width: 150px;
    }
</style>
<script type="text/javascript">

function init () {
	
	var C = YAHOO.util.Connect,
			J = YAHOO.lang.JSON,
			E = YAHOO.util.Event,
			D = YAHOO.util.Dom;
			
	var log = function (m) {
		var r = D.get('log');
		r.innerHTML = r.innerHTML + '<br>' + m;
	};
			
	// C.asyncRequest('GET', 'http://noodlehaus.com/livematch.js', {
	C.asyncRequest('GET', 'livematch.js', {
		success : function (o) {
			try {
				var x = J.parse(o.responseText);
				log('YUI JSON util result = ' + x.headline);
			} catch (e) {
				log('YUI JSON util failed!');
			}
			try {
				var y = eval('(' + o.responseText + ')');
				log('eval() result = ' + y.headline);
			} catch (e) {
				log('eval() attempt failed!');
			}
			log('end of tests.');
		},
		failure : function (o) {
			log('AJAX request failed!' + YAHOO.lang.dump(o));
		}
	});
}

init();

</script>
<body>

<div id="linkContainer">
  <h3>Header does nothing</h3>
</div>
<div id='log'></div>
<input id="addButton" type="button" value="Add link" />
</body>

</html>

